package com.yonyou.crm.sys.user.rmimpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonyou.crm.common.page.entity.Page;
import com.yonyou.crm.sys.user.entity.UserVO;
import com.yonyou.crm.sys.user.itf.IUserBizService;
import com.yonyou.crm.sys.user.rmitf.IUserRmService;

@Service("userService")
public class UserRmServiceImpl implements IUserRmService {

	@Autowired
	private IUserBizService userBizService;

	public Page<UserVO> page(Page<UserVO> page,Map<String, Object> paraMap) {
		return userBizService.getPage(page, paraMap);
	}
	
	public UserVO detail(Long id) {
		return userBizService.getDetail(id);
	}
	
	public UserVO insert(UserVO user) {
		return userBizService.insert(user);
	}
	
	public UserVO update(UserVO user) {
		return userBizService.update(user);
	}
	
	public String batchDelete(String[] ids) {
		return userBizService.batchDelete(ids);
	}

	public String batchUpdateEnableState(String[] ids, Integer enableState) {
		return userBizService.batchUpdateEnableState(ids, enableState);
	}
	
	public int getUserCountByJob(Long orgId) {
		return userBizService.getUserCountByJob(orgId);
	}
	
	public Object selectFieldsByIds(Object[] ids) {
		return userBizService.selectFieldsByIds(ids);
	}

	@Override
	public List<Map<String, Object>> getUserByDeptId(Long deptId, String condition) {
		return userBizService.getUserByDeptId(deptId, condition);
	}

	@Override
	public List<UserVO> batchUpdateAdmin(List<UserVO> voList) {
		return userBizService.batchUpdateAdmin(voList);
	}

	@Override
	public List<UserVO> getAdminList(Map<String, Object> paramMap) {
		return userBizService.getAdminList(paramMap);
	}
	
	@Override
	public Map<String, Object> getDeptAndUserList(Map<String, Object> paramMap){
		return userBizService.getDeptAndUserList(paramMap);
	}
	
	@Override
	public Page<UserVO> getOrgUserList(Page<UserVO> page,Map<String, Object> paraMap) {
		return userBizService.getOrgUserList(page, paraMap);
	}
	
	public List<UserVO> getUserListExport(Map<String, Object> paraMap) {
		return userBizService.getUserListExport(paraMap);
	}

	@Override
	public List<UserVO> getRefList(Map<String, Object> paraMap) {
		return userBizService.getRefList(paraMap);
	}

	@Override
	public Page<UserVO> getRefPage(Page<UserVO> page, Map<String, Object> paraMap) {
		return userBizService.getRefPage(page, paraMap);
	}

	@Override
	public void allocateRole(String[] userIds, Long roleId) {
		userBizService.allocateRole(userIds, roleId);
	}

	@Override
	public void updatePassword(Long userId, String password) {
		userBizService.updatePassword(userId, password);
	}

	@Override
	public List<Map<String, Object>> getSubdepts() {
		return userBizService.getSubdeptsForCurrentUser();
	}

}
